<form method=post style='pposition: relative; width:290px; float:left; padding-bottom:20px;'>
	<table style='font-size:15px;'>
		<tr>
			<td style="text-align:right;">
				Логин: 
			</td>
			<td>
				<input type=text name='log' size=25 />
			</td>
		</tr>
		<tr>
			<td style="text-align:right;">
				Пароль:
			</td>
			<td>
				<input type=password name='pwd' size=25 />
			</td>
		</tr>
<!--
		<tr>
			<td colspan=2>
				<input type=checkbox name='remember' /> Запомнить
			</td>
		</tr>
-->
		<tr>
			<td colspan=2 style='text-align:center;'>
				<a href='#' id='forgot_pwd' style='text-decoration:none; border-bottom:1px dotted gray;'>Забыли пароль?</a>
			</td>
		</tr>
		<tr>
			<td colspan=2 style="text-align:right;">
				<button type=submit class='normal'>Войти</button>
			</td>
		</tr>
	</table>
</form>

<div id='remind_pwd' style='position:absolute; display:none; padding:10px; background-color: white; font-size:15px; border:1px solid gray;'>
	<form>
		Ваш email: <input type=text name='email' size=15>
		<button type='submit' class='normal'>Выслать</button>
	</form>
</div>

<script>
$(function(){
	$(document).keyup(function(e) {
		if (e.keyCode == 27) { $('#remind_pwd').hide(); }
	});
	
	$('#remind_pwd form').submit(function(e){
		e.preventDefault();
		$(this).closest('#remind_pwd').hide();
		
		var email = $('#remind_pwd input[name=email]').val();
		call('user.resetPwd',{ 'email':email }).done(function(logPwd){
			var txt = 'Логин: '+logPwd[0]+'<br>Пароль:'+logPwd[1];
			call('user.sendMessage',{ 'email':email, 'subject':'Новый пароль на FASHION IQ', 'txt':txt });
		});
	});

	$('#forgot_pwd').click(function(e){
		e.preventDefault();
		if ($('#remind_pwd').is(':visible')) {
			$('#remind_pwd').hide();
		} else {
			$('#remind_pwd')
				.css('top',$(this).offset().top+$(this).height())
				.css('left',$(this).offset().left)
				.show();
			$('#remind_pwd').find('input').focus();
		}
	});
});
</script>